package com.ezerg.rpc;

import java.io.IOException;
import java.net.InetSocketAddress;

public class RPCTest {
    public static void main(String[] args) throws IOException {
        new Thread(new Runnable() {
            public void run() {
                try {
                	RPCServer serviceServer = new RPCServer(8888);
                    serviceServer.register(RPCService.class, RPCServiceImpl.class);
                    serviceServer.start();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }).start();
        RPCService service = RPCClient.getRemoteProxyObj(RPCService.class, new InetSocketAddress("localhost", 8888));
        System.out.println(service.rpc());
    }

}
